// 接口返回数据转换为Table需要的数据格式
function changeToSimpletableDatas(data){
    let rows = []
    data.forEach((item, index) => {
        let obj = {}
        Object.keys(item).map((key) => {
            if(typeof(item[key])=='object'){
                item[key].display=item[key].diaplay?item[key].display:(item[key].value?item[key].value:'');
                item[key].value=item[key].value?item[key].value:(item[key].display?item[key].display:'');
                obj[key]=item[key];
            }else{
                obj[key] = { 'value': item[key], 'display': item[key] };
            }
            return null;
        })
        rows[index] = {
            "status": "0",
            "isOptimized": false,
            values: obj
        }
        delete obj.status
    });
    return rows;
}
export {changeToSimpletableDatas}